/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-06 16:15:11
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-06 17:00:28
 */
import React from 'react'

class RenderProps extends React.Component {
  state = {
    X: 0,
    Y: 0,
  }
  render() {
    console.log(this.props, 7)
    // return (
    //   <div>
    //     御剑乘风来,除魔天地间=====RenderProps X:{this.state.X}===Y:
    //     {this.state.Y}
    //   </div>
    // )
    // return this.props.render(this.state)
    return this.props.children(this.state)
  }
  componentDidMount() {
    document.addEventListener('mousemove', (e) => {
      // console.log(e, 88)
      this.setState({
        X: e.clientX,
        Y: e.clientY,
      })
    })
  }
}
export default RenderProps
